﻿using System.Collections.Generic;
using ZyGames.DZPocker.Model;
using ZyGames.Framework.Game.Contract;
using ZyGames.Framework.Common.Serialization;

namespace ZyGames.DZPocker.Script.CsScript.Action
{
	/// <summary>
	/// 10041主动推送其他信息给当前进入房间的玩家
	/// </summary>
	public class Action10041 : BaseAction
	{
		private string tableDataStr;
		private int masterUserId;
		private string masterName;
		public Action10041(HttpGet actionGetter)
			: base((short)ActionType.DZNotifyOtherInfoForMe, actionGetter)
		{
		}
		public override bool GetUrlElement()
		{
			if (httpGet.GetString("TableData", ref tableDataStr) &&
				httpGet.GetString("TableMasterName", ref masterName) &&
				httpGet.GetInt("TableMasterUserID", ref masterUserId))
			{
				return true;
			}
			return false;
		}

		public override bool TakeAction()
		{ 
			return true;
		}

		public override void BuildPacket()
		{
			this.PushIntoStack(tableDataStr);
			this.PushIntoStack(masterName);
			this.PushIntoStack(masterUserId);
		}
	}
}
